<?php
 include "counter.php";
 if (!$orderby) {
    $orderby = "f_mtime";
 }
?>
<HTML>
<?php pagehead("Lost people") ?>
<BODY>
<?php pagetop("Lost people") ?>
These people are removed from the counter. Their data is still
 preserved, but they are not included in the count.
<p>
If you want to, you can try to hunt them down and ask if they still
 use Linux.
<p>
<?php
   $query = mysql_query(
        "select count(*) from users where
	      users.state = 'frozen'");
   if (!$query) {
       print("MySQL error: " . mysql_errno() . ":" . mysql_error() . "<br>");

	die("Query failed");
   }
   $r = mysql_fetch_row($query);
   print "There are $r[0] such people. Here are the oldest among them.";
 
   $query = mysql_query(
        "select users.f_key, users.email, users.logintime,
        users.f_mtime from users where users.state = 'frozen'
	order by $orderby limit 50");

   if (!$query) {
       print("MySQL error: " . mysql_errno() . ":" . mysql_error() . "<br>");

	die("Query failed");
   }

   $thispage =  "https://" . $HTTP_HOST . "/" . $REQUEST_URI;


?>
<table class="info" border>
<tr><th>Key<th>Email<th>Last login<th>Last touched
<?php

  while ($arr = mysql_fetch_row($query)) {
	$arr[0] = htmlspecialchars($arr[0]);
	echo "<tr><td>";
	echo "<a href=\"display-person.php?user=$arr[0]\">$arr[0]</a>";
	echo "<td>" . htmlspecialchars($arr[1]);
	echo "<td>" . htmlspecialchars($arr[2]);
	echo "<td>" . htmlspecialchars($arr[3]);
 }
?>
</table>
<?php pagebottom() ?>
</body>
</html>
